package 分类.双指针;

public class 删除有序数组中的重复项 {
    public int removeDuplicates(int[] nums) {
        int slow=0,fast=0;
        while (fast<nums.length){
            if(nums[fast]!=nums[slow]){
                slow++;
                nums[slow]=nums[fast];
            }
            fast++;
        }
        return slow+1;
    }
}
